//
//  Copyright (c) 2021-present, Cruise LLC
//
//  This source code is licensed under the Apache License, Version 2.0,
//  found in the LICENSE file in the root directory of this source tree.
//  You may not use this file except in compliance with the License.

import { RGBA } from "./types";

export const COLORS = {
  DARK: { r: 0.03, g: 0.03, b: 0.04, a: 1 },
  DARK1: { r: 0.07, g: 0.07, b: 0.08, a: 1 },
  DARK2: { r: 0.1, g: 0.1, b: 0.12, a: 1 },
  DARK3: { r: 0.14, g: 0.14, b: 0.16, a: 1 },
  DARK4: { r: 0.18, g: 0.18, b: 0.2, a: 1 },
  DARK5: { r: 0.21, g: 0.21, b: 0.24, a: 1 },
  DARK6: { r: 0.25, g: 0.25, b: 0.28, a: 1 },
  DARK7: { r: 0.29, g: 0.29, b: 0.32, a: 1 },
  DARK8: { r: 0.33, g: 0.33, b: 0.36, a: 1 },
  DARK9: { r: 0.38, g: 0.38, b: 0.4, a: 1 },
  LIGHT: { r: 1.0, g: 1.0, b: 1.0, a: 1 },
  LIGHT1: { r: 0.94, g: 0.94, b: 0.94, a: 1 },
  LIGHT2: { r: 0.79, g: 0.79, b: 0.8, a: 1 },
  GRAY: { r: 0.62, g: 0.62, b: 0.64, a: 1 },
  GRAY2: { r: 0.18, g: 0.17, b: 0.2, a: 1 },
  MAGENTAL1: { r: 0.88, g: 0.37, b: 0.98, a: 1 },
  MAGENTA: { r: 0.78, g: 0.24, b: 0.92, a: 1 },
  MAGENTA1: { r: 0.69, g: 0.14, b: 0.84, a: 1 },
  PURPLEL1: { r: 0.6, g: 0.53, b: 1.0, a: 1 },
  PURPLE: { r: 0.49, g: 0.42, b: 1.0, a: 1 },
  PURPLE1: { r: 0.41, g: 0.35, b: 0.96, a: 1 },
  BLUEL1: { r: 0.27, g: 0.65, b: 1.0, a: 1 },
  BLUE: { r: 0.14, g: 0.56, b: 1.0, a: 1 },
  BLUE1: { r: 0.06, g: 0.44, b: 0.95, a: 1 },
  TEALL1: { r: 0.16, g: 0.75, b: 0.82, a: 1 },
  TEAL: { r: 0.0, g: 0.66, b: 0.76, a: 1 },
  TEAL1: { r: 0.0, g: 0.56, b: 0.68, a: 1 },
  GREENL1: { r: 0.1, g: 0.74, b: 0.54, a: 1 },
  GREEN: { r: 0.0, g: 0.64, b: 0.46, a: 1 },
  GREEN1: { r: 0.0, g: 0.53, b: 0.41, a: 1 },
  LIMEL1: { r: 0.42, g: 0.84, b: 0.44, a: 1 },
  LIME: { r: 0.29, g: 0.76, b: 0.32, a: 1 },
  LIME1: { r: 0.19, g: 0.68, b: 0.29, a: 1 },
  YELLOWL1: { r: 0.96, g: 0.83, b: 0.35, a: 1 },
  YELLOW: { r: 0.97, g: 0.75, b: 0.0, a: 1 },
  YELLOW1: { r: 0.92, g: 0.66, b: 0.0, a: 1 },
  ORANGEL1: { r: 0.99, g: 0.54, b: 0.26, a: 1 },
  ORANGE: { r: 0.97, g: 0.42, b: 0.11, a: 1 },
  ORANGE1: { r: 0.9, g: 0.33, b: 0.04, a: 1 },
  REDL1: { r: 1.0, g: 0.42, b: 0.51, a: 1 },
  RED: { r: 0.96, g: 0.29, b: 0.4, a: 1 },
  RED1: { r: 0.86, g: 0.21, b: 0.33, a: 1 },
  RED2: { r: 1.0, g: 0.49, b: 0.59, a: 1 },
};

export const SEMANTIC_CLASS_TO_COLOR_MAP = {
  "1": COLORS.BLUE, // CAR
  "2": COLORS.TEAL, // HUMAN
  "3": COLORS.PURPLE, // BIKE
  "4": COLORS.PURPLE1, // MOTORCYCLE
  "5": COLORS.BLUE, // TRUCK
  "6": COLORS.BLUE, // BUS
  "7": COLORS.BLUE, // SCHOOL_BUS
  "8": COLORS.RED, // EMV
  "9": COLORS.BLUE, // TRAIN
  "10": COLORS.BLUE, // ANIMAL
  "2000": COLORS.LIME, // STATIC_UNKNOWN
  defaultColor: COLORS.LIME,
};

export type HSL = {
  h: number;
  s: number;
  l: number;
};

/**
* "Rotates" the given color around the HSL color wheel by an amount between 0 and 1
* Similar to CSS hue-rotate() function: https://www.quackit.com/css/functions/css_hue-rotate_function.cfm
*/
export function rotateHue(color: RGBA, amount: number): RGBA {
  const { h, s, l } = rgbToHsl(color);
  const { r, g, b } = hslToRgb({ h: (h + amount + 1) % 1, s, l });
  return { r, g, b, a: color.a };
}

/**
* Converts an RGBA color into a hue-saturation-luminance (HSL) color
*/
export function rgbToHsl(rgbColor: RGBA): HSL {
  const { r, g, b } = rgbColor;
  const max = Math.max(r, g, b);
  const min = Math.min(r, g, b);
  const l = (max + min) / 2;
  let h = 0;
  let s;

  if (Math.abs(max - min) <= 0.001) {
    h = s = 0; // achromatic
  } else {
    const d = max - min;
    s = l > 0.5 ? d / (2 - max - min) : d / (max + min);

    switch (max) {
      case r:
        h = (g - b) / d + (g < b ? 6 : 0);
        break;
      case g:
        h = (b - r) / d + 2;
        break;
      case b:
        h = (r - g) / d + 4;
        break;
    }
    h /= 6;
  }
  return { h, s, l };
}

/**
* Converts an HSL color into a RGBA color
*/
export function hslToRgb(color: HSL): RGBA {
  const { h, s, l } = color;
  let r, g, b;

  if (s === 0) {
    r = g = b = l; // achromatic
  } else {
    const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
    const p = 2 * l - q;
    r = hueToColorComponent(p, q, h + 1 / 3);
    g = hueToColorComponent(p, q, h);
    b = hueToColorComponent(p, q, h - 1 / 3);
  }
  return { r, g, b, a: 1 };
}

function hueToColorComponent(p: number, q: number, tRaw: number): number {
  const t = (tRaw + 1) % 1;
  if (t < 1 / 6) {
    return p + (q - p) * 6 * t;
  }
  if (t < 1 / 2) {
    return q;
  }
  if (t < 2 / 3) {
    return p + (q - p) * (2 / 3 - t) * 6;
  }
  return p;
}

/**
* Samples a colormap.
* @param colormap 256 entry rgb array
* @param x value between 0-1 that linearly interpolates the colormap
* @returns RGBA color
*/
export function interpolateColormap(colormap: number[][], x: number): RGBA {
  x = Math.max(0.0, Math.min(1.0, x));
  const a = Math.floor(x * 255.0);
  const b = Math.min(255, a + 1);
  const f = x * 255.0 - a;
  return {
    r: colormap[a][0] + (colormap[b][0] - colormap[a][0]) * f,
    g: colormap[a][1] + (colormap[b][1] - colormap[a][1]) * f,
    b: colormap[a][2] + (colormap[b][2] - colormap[a][2]) * f,
    a: 1.0
  };
}

export const VIRIDIS_COLORMAP = [
  [0.267004, 0.004874, 0.329415],
  [0.268510, 0.009605, 0.335427],
  [0.269944, 0.014625, 0.341379],
  [0.271305, 0.019942, 0.347269],
  [0.272594, 0.025563, 0.353093],
  [0.273809, 0.031497, 0.358853],
  [0.274952, 0.037752, 0.364543],
  [0.276022, 0.044167, 0.370164],
  [0.277018, 0.050344, 0.375715],
  [0.277941, 0.056324, 0.381191],
  [0.278791, 0.062145, 0.386592],
  [0.279566, 0.067836, 0.391917],
  [0.280267, 0.073417, 0.397163],
  [0.280894, 0.078907, 0.402329],
  [0.281446, 0.084320, 0.407414],
  [0.281924, 0.089666, 0.412415],
  [0.282327, 0.094955, 0.417331],
  [0.282656, 0.100196, 0.422160],
  [0.282910, 0.105393, 0.426902],
  [0.283091, 0.110553, 0.431554],
  [0.283197, 0.115680, 0.436115],
  [0.283229, 0.120777, 0.440584],
  [0.283187, 0.125848, 0.444960],
  [0.283072, 0.130895, 0.449241],
  [0.282884, 0.135920, 0.453427],
  [0.282623, 0.140926, 0.457517],
  [0.282290, 0.145912, 0.461510],
  [0.281887, 0.150881, 0.465405],
  [0.281412, 0.155834, 0.469201],
  [0.280868, 0.160771, 0.472899],
  [0.280255, 0.165693, 0.476498],
  [0.279574, 0.170599, 0.479997],
  [0.278826, 0.175490, 0.483397],
  [0.278012, 0.180367, 0.486697],
  [0.277134, 0.185228, 0.489898],
  [0.276194, 0.190074, 0.493001],
  [0.275191, 0.194905, 0.496005],
  [0.274128, 0.199721, 0.498911],
  [0.273006, 0.204520, 0.501721],
  [0.271828, 0.209303, 0.504434],
  [0.270595, 0.214069, 0.507052],
  [0.269308, 0.218818, 0.509577],
  [0.267968, 0.223549, 0.512008],
  [0.266580, 0.228262, 0.514349],
  [0.265145, 0.232956, 0.516599],
  [0.263663, 0.237631, 0.518762],
  [0.262138, 0.242286, 0.520837],
  [0.260571, 0.246922, 0.522828],
  [0.258965, 0.251537, 0.524736],
  [0.257322, 0.256130, 0.526563],
  [0.255645, 0.260703, 0.528312],
  [0.253935, 0.265254, 0.529983],
  [0.252194, 0.269783, 0.531579],
  [0.250425, 0.274290, 0.533103],
  [0.248629, 0.278775, 0.534556],
  [0.246811, 0.283237, 0.535941],
  [0.244972, 0.287675, 0.537260],
  [0.243113, 0.292092, 0.538516],
  [0.241237, 0.296485, 0.539709],
  [0.239346, 0.300855, 0.540844],
  [0.237441, 0.305202, 0.541921],
  [0.235526, 0.309527, 0.542944],
  [0.233603, 0.313828, 0.543914],
  [0.231674, 0.318106, 0.544834],
  [0.229739, 0.322361, 0.545706],
  [0.227802, 0.326594, 0.546532],
  [0.225863, 0.330805, 0.547314],
  [0.223925, 0.334994, 0.548053],
  [0.221989, 0.339161, 0.548752],
  [0.220057, 0.343307, 0.549413],
  [0.218130, 0.347432, 0.550038],
  [0.216210, 0.351535, 0.550627],
  [0.214298, 0.355619, 0.551184],
  [0.212395, 0.359683, 0.551710],
  [0.210503, 0.363727, 0.552206],
  [0.208623, 0.367752, 0.552675],
  [0.206756, 0.371758, 0.553117],
  [0.204903, 0.375746, 0.553533],
  [0.203063, 0.379716, 0.553925],
  [0.201239, 0.383670, 0.554294],
  [0.199430, 0.387607, 0.554642],
  [0.197636, 0.391528, 0.554969],
  [0.195860, 0.395433, 0.555276],
  [0.194100, 0.399323, 0.555565],
  [0.192357, 0.403199, 0.555836],
  [0.190631, 0.407061, 0.556089],
  [0.188923, 0.410910, 0.556326],
  [0.187231, 0.414746, 0.556547],
  [0.185556, 0.418570, 0.556753],
  [0.183898, 0.422383, 0.556944],
  [0.182256, 0.426184, 0.557120],
  [0.180629, 0.429975, 0.557282],
  [0.179019, 0.433756, 0.557430],
  [0.177423, 0.437527, 0.557565],
  [0.175841, 0.441290, 0.557685],
  [0.174274, 0.445044, 0.557792],
  [0.172719, 0.448791, 0.557885],
  [0.171176, 0.452530, 0.557965],
  [0.169646, 0.456262, 0.558030],
  [0.168126, 0.459988, 0.558082],
  [0.166617, 0.463708, 0.558119],
  [0.165117, 0.467423, 0.558141],
  [0.163625, 0.471133, 0.558148],
  [0.162142, 0.474838, 0.558140],
  [0.160665, 0.478540, 0.558115],
  [0.159194, 0.482237, 0.558073],
  [0.157729, 0.485932, 0.558013],
  [0.156270, 0.489624, 0.557936],
  [0.154815, 0.493313, 0.557840],
  [0.153364, 0.497000, 0.557724],
  [0.151918, 0.500685, 0.557587],
  [0.150476, 0.504369, 0.557430],
  [0.149039, 0.508051, 0.557250],
  [0.147607, 0.511733, 0.557049],
  [0.146180, 0.515413, 0.556823],
  [0.144759, 0.519093, 0.556572],
  [0.143343, 0.522773, 0.556295],
  [0.141935, 0.526453, 0.555991],
  [0.140536, 0.530132, 0.555659],
  [0.139147, 0.533812, 0.555298],
  [0.137770, 0.537492, 0.554906],
  [0.136408, 0.541173, 0.554483],
  [0.135066, 0.544853, 0.554029],
  [0.133743, 0.548535, 0.553541],
  [0.132444, 0.552216, 0.553018],
  [0.131172, 0.555899, 0.552459],
  [0.129933, 0.559582, 0.551864],
  [0.128729, 0.563265, 0.551229],
  [0.127568, 0.566949, 0.550556],
  [0.126453, 0.570633, 0.549841],
  [0.125394, 0.574318, 0.549086],
  [0.124395, 0.578002, 0.548287],
  [0.123463, 0.581687, 0.547445],
  [0.122606, 0.585371, 0.546557],
  [0.121831, 0.589055, 0.545623],
  [0.121148, 0.592739, 0.544641],
  [0.120565, 0.596422, 0.543611],
  [0.120092, 0.600104, 0.542530],
  [0.119738, 0.603785, 0.541400],
  [0.119512, 0.607464, 0.540218],
  [0.119423, 0.611141, 0.538982],
  [0.119483, 0.614817, 0.537692],
  [0.119699, 0.618490, 0.536347],
  [0.120081, 0.622161, 0.534946],
  [0.120638, 0.625828, 0.533488],
  [0.121380, 0.629492, 0.531973],
  [0.122312, 0.633153, 0.530398],
  [0.123444, 0.636809, 0.528763],
  [0.124780, 0.640461, 0.527068],
  [0.126326, 0.644107, 0.525311],
  [0.128087, 0.647749, 0.523491],
  [0.130067, 0.651384, 0.521608],
  [0.132268, 0.655014, 0.519661],
  [0.134692, 0.658636, 0.517649],
  [0.137339, 0.662252, 0.515571],
  [0.140210, 0.665859, 0.513427],
  [0.143303, 0.669459, 0.511215],
  [0.146616, 0.673050, 0.508936],
  [0.150148, 0.676631, 0.506589],
  [0.153894, 0.680203, 0.504172],
  [0.157851, 0.683765, 0.501686],
  [0.162016, 0.687316, 0.499129],
  [0.166383, 0.690856, 0.496502],
  [0.170948, 0.694384, 0.493803],
  [0.175707, 0.697900, 0.491033],
  [0.180653, 0.701402, 0.488189],
  [0.185783, 0.704891, 0.485273],
  [0.191090, 0.708366, 0.482284],
  [0.196571, 0.711827, 0.479221],
  [0.202219, 0.715272, 0.476084],
  [0.208030, 0.718701, 0.472873],
  [0.214000, 0.722114, 0.469588],
  [0.220124, 0.725509, 0.466226],
  [0.226397, 0.728888, 0.462789],
  [0.232815, 0.732247, 0.459277],
  [0.239374, 0.735588, 0.455688],
  [0.246070, 0.738910, 0.452024],
  [0.252899, 0.742211, 0.448284],
  [0.259857, 0.745492, 0.444467],
  [0.266941, 0.748751, 0.440573],
  [0.274149, 0.751988, 0.436601],
  [0.281477, 0.755203, 0.432552],
  [0.288921, 0.758394, 0.428426],
  [0.296479, 0.761561, 0.424223],
  [0.304148, 0.764704, 0.419943],
  [0.311925, 0.767822, 0.415586],
  [0.319809, 0.770914, 0.411152],
  [0.327796, 0.773980, 0.406640],
  [0.335885, 0.777018, 0.402049],
  [0.344074, 0.780029, 0.397381],
  [0.352360, 0.783011, 0.392636],
  [0.360741, 0.785964, 0.387814],
  [0.369214, 0.788888, 0.382914],
  [0.377779, 0.791781, 0.377939],
  [0.386433, 0.794644, 0.372886],
  [0.395174, 0.797475, 0.367757],
  [0.404001, 0.800275, 0.362552],
  [0.412913, 0.803041, 0.357269],
  [0.421908, 0.805774, 0.351910],
  [0.430983, 0.808473, 0.346476],
  [0.440137, 0.811138, 0.340967],
  [0.449368, 0.813768, 0.335384],
  [0.458674, 0.816363, 0.329727],
  [0.468053, 0.818921, 0.323998],
  [0.477504, 0.821444, 0.318195],
  [0.487026, 0.823929, 0.312321],
  [0.496615, 0.826376, 0.306377],
  [0.506271, 0.828786, 0.300362],
  [0.515992, 0.831158, 0.294279],
  [0.525776, 0.833491, 0.288127],
  [0.535621, 0.835785, 0.281908],
  [0.545524, 0.838039, 0.275626],
  [0.555484, 0.840254, 0.269281],
  [0.565498, 0.842430, 0.262877],
  [0.575563, 0.844566, 0.256415],
  [0.585678, 0.846661, 0.249897],
  [0.595839, 0.848717, 0.243329],
  [0.606045, 0.850733, 0.236712],
  [0.616293, 0.852709, 0.230052],
  [0.626579, 0.854645, 0.223353],
  [0.636902, 0.856542, 0.216620],
  [0.647257, 0.858400, 0.209861],
  [0.657642, 0.860219, 0.203082],
  [0.668054, 0.861999, 0.196293],
  [0.678489, 0.863742, 0.189503],
  [0.688944, 0.865448, 0.182725],
  [0.699415, 0.867117, 0.175971],
  [0.709898, 0.868751, 0.169257],
  [0.720391, 0.870350, 0.162603],
  [0.730889, 0.871916, 0.156029],
  [0.741388, 0.873449, 0.149561],
  [0.751884, 0.874951, 0.143228],
  [0.762373, 0.876424, 0.137064],
  [0.772852, 0.877868, 0.131109],
  [0.783315, 0.879285, 0.125405],
  [0.793760, 0.880678, 0.120005],
  [0.804182, 0.882046, 0.114965],
  [0.814576, 0.883393, 0.110347],
  [0.824940, 0.884720, 0.106217],
  [0.835270, 0.886029, 0.102646],
  [0.845561, 0.887322, 0.099702],
  [0.855810, 0.888601, 0.097452],
  [0.866013, 0.889868, 0.095953],
  [0.876168, 0.891125, 0.095250],
  [0.886271, 0.892374, 0.095374],
  [0.896320, 0.893616, 0.096335],
  [0.906311, 0.894855, 0.098125],
  [0.916242, 0.896091, 0.100717],
  [0.926106, 0.897330, 0.104071],
  [0.935904, 0.898570, 0.108131],
  [0.945636, 0.899815, 0.112838],
  [0.955300, 0.901065, 0.118128],
  [0.964894, 0.902323, 0.123941],
  [0.974417, 0.903590, 0.130215],
  [0.983868, 0.904867, 0.136897],
  [0.993248, 0.906157, 0.143936]
];

export const INFERNO_COLORMAP = [
  [0.001462, 0.000466, 0.013866],
  [0.002267, 0.001270, 0.018570],
  [0.003299, 0.002249, 0.024239],
  [0.004547, 0.003392, 0.030909],
  [0.006006, 0.004692, 0.038558],
  [0.007676, 0.006136, 0.046836],
  [0.009561, 0.007713, 0.055143],
  [0.011663, 0.009417, 0.063460],
  [0.013995, 0.011225, 0.071862],
  [0.016561, 0.013136, 0.080282],
  [0.019373, 0.015133, 0.088767],
  [0.022447, 0.017199, 0.097327],
  [0.025793, 0.019331, 0.105930],
  [0.029432, 0.021503, 0.114621],
  [0.033385, 0.023702, 0.123397],
  [0.037668, 0.025921, 0.132232],
  [0.042253, 0.028139, 0.141141],
  [0.046915, 0.030324, 0.150164],
  [0.051644, 0.032474, 0.159254],
  [0.056449, 0.034569, 0.168414],
  [0.061340, 0.036590, 0.177642],
  [0.066331, 0.038504, 0.186962],
  [0.071429, 0.040294, 0.196354],
  [0.076637, 0.041905, 0.205799],
  [0.081962, 0.043328, 0.215289],
  [0.087411, 0.044556, 0.224813],
  [0.092990, 0.045583, 0.234358],
  [0.098702, 0.046402, 0.243904],
  [0.104551, 0.047008, 0.253430],
  [0.110536, 0.047399, 0.262912],
  [0.116656, 0.047574, 0.272321],
  [0.122908, 0.047536, 0.281624],
  [0.129285, 0.047293, 0.290788],
  [0.135778, 0.046856, 0.299776],
  [0.142378, 0.046242, 0.308553],
  [0.149073, 0.045468, 0.317085],
  [0.155850, 0.044559, 0.325338],
  [0.162689, 0.043554, 0.333277],
  [0.169575, 0.042489, 0.340874],
  [0.176493, 0.041402, 0.348111],
  [0.183429, 0.040329, 0.354971],
  [0.190367, 0.039309, 0.361447],
  [0.197297, 0.038400, 0.367535],
  [0.204209, 0.037632, 0.373238],
  [0.211095, 0.037030, 0.378563],
  [0.217949, 0.036615, 0.383522],
  [0.224763, 0.036405, 0.388129],
  [0.231538, 0.036405, 0.392400],
  [0.238273, 0.036621, 0.396353],
  [0.244967, 0.037055, 0.400007],
  [0.251620, 0.037705, 0.403378],
  [0.258234, 0.038571, 0.406485],
  [0.264810, 0.039647, 0.409345],
  [0.271347, 0.040922, 0.411976],
  [0.277850, 0.042353, 0.414392],
  [0.284321, 0.043933, 0.416608],
  [0.290763, 0.045644, 0.418637],
  [0.297178, 0.047470, 0.420491],
  [0.303568, 0.049396, 0.422182],
  [0.309935, 0.051407, 0.423721],
  [0.316282, 0.053490, 0.425116],
  [0.322610, 0.055634, 0.426377],
  [0.328921, 0.057827, 0.427511],
  [0.335217, 0.060060, 0.428524],
  [0.341500, 0.062325, 0.429425],
  [0.347771, 0.064616, 0.430217],
  [0.354032, 0.066925, 0.430906],
  [0.360284, 0.069247, 0.431497],
  [0.366529, 0.071579, 0.431994],
  [0.372768, 0.073915, 0.432400],
  [0.379001, 0.076253, 0.432719],
  [0.385228, 0.078591, 0.432955],
  [0.391453, 0.080927, 0.433109],
  [0.397674, 0.083257, 0.433183],
  [0.403894, 0.085580, 0.433179],
  [0.410113, 0.087896, 0.433098],
  [0.416331, 0.090203, 0.432943],
  [0.422549, 0.092501, 0.432714],
  [0.428768, 0.094790, 0.432412],
  [0.434987, 0.097069, 0.432039],
  [0.441207, 0.099338, 0.431594],
  [0.447428, 0.101597, 0.431080],
  [0.453651, 0.103848, 0.430498],
  [0.459875, 0.106089, 0.429846],
  [0.466100, 0.108322, 0.429125],
  [0.472328, 0.110547, 0.428334],
  [0.478558, 0.112764, 0.427475],
  [0.484789, 0.114974, 0.426548],
  [0.491022, 0.117179, 0.425552],
  [0.497257, 0.119379, 0.424488],
  [0.503493, 0.121575, 0.423356],
  [0.509730, 0.123769, 0.422156],
  [0.515967, 0.125960, 0.420887],
  [0.522206, 0.128150, 0.419549],
  [0.528444, 0.130341, 0.418142],
  [0.534683, 0.132534, 0.416667],
  [0.540920, 0.134729, 0.415123],
  [0.547157, 0.136929, 0.413511],
  [0.553392, 0.139134, 0.411829],
  [0.559624, 0.141346, 0.410078],
  [0.565854, 0.143567, 0.408258],
  [0.572081, 0.145797, 0.406369],
  [0.578304, 0.148039, 0.404411],
  [0.584521, 0.150294, 0.402385],
  [0.590734, 0.152563, 0.400290],
  [0.596940, 0.154848, 0.398125],
  [0.603139, 0.157151, 0.395891],
  [0.609330, 0.159474, 0.393589],
  [0.615513, 0.161817, 0.391219],
  [0.621685, 0.164184, 0.388781],
  [0.627847, 0.166575, 0.386276],
  [0.633998, 0.168992, 0.383704],
  [0.640135, 0.171438, 0.381065],
  [0.646260, 0.173914, 0.378359],
  [0.652369, 0.176421, 0.375586],
  [0.658463, 0.178962, 0.372748],
  [0.664540, 0.181539, 0.369846],
  [0.670599, 0.184153, 0.366879],
  [0.676638, 0.186807, 0.363849],
  [0.682656, 0.189501, 0.360757],
  [0.688653, 0.192239, 0.357603],
  [0.694627, 0.195021, 0.354388],
  [0.700576, 0.197851, 0.351113],
  [0.706500, 0.200728, 0.347777],
  [0.712396, 0.203656, 0.344383],
  [0.718264, 0.206636, 0.340931],
  [0.724103, 0.209670, 0.337424],
  [0.729909, 0.212759, 0.333861],
  [0.735683, 0.215906, 0.330245],
  [0.741423, 0.219112, 0.326576],
  [0.747127, 0.222378, 0.322856],
  [0.752794, 0.225706, 0.319085],
  [0.758422, 0.229097, 0.315266],
  [0.764010, 0.232554, 0.311399],
  [0.769556, 0.236077, 0.307485],
  [0.775059, 0.239667, 0.303526],
  [0.780517, 0.243327, 0.299523],
  [0.785929, 0.247056, 0.295477],
  [0.791293, 0.250856, 0.291390],
  [0.796607, 0.254728, 0.287264],
  [0.801871, 0.258674, 0.283099],
  [0.807082, 0.262692, 0.278898],
  [0.812239, 0.266786, 0.274661],
  [0.817341, 0.270954, 0.270390],
  [0.822386, 0.275197, 0.266085],
  [0.827372, 0.279517, 0.261750],
  [0.832299, 0.283913, 0.257383],
  [0.837165, 0.288385, 0.252988],
  [0.841969, 0.292933, 0.248564],
  [0.846709, 0.297559, 0.244113],
  [0.851384, 0.302260, 0.239636],
  [0.855992, 0.307038, 0.235133],
  [0.860533, 0.311892, 0.230606],
  [0.865006, 0.316822, 0.226055],
  [0.869409, 0.321827, 0.221482],
  [0.873741, 0.326906, 0.216886],
  [0.878001, 0.332060, 0.212268],
  [0.882188, 0.337287, 0.207628],
  [0.886302, 0.342586, 0.202968],
  [0.890341, 0.347957, 0.198286],
  [0.894305, 0.353399, 0.193584],
  [0.898192, 0.358911, 0.188860],
  [0.902003, 0.364492, 0.184116],
  [0.905735, 0.370140, 0.179350],
  [0.909390, 0.375856, 0.174563],
  [0.912966, 0.381636, 0.169755],
  [0.916462, 0.387481, 0.164924],
  [0.919879, 0.393389, 0.160070],
  [0.923215, 0.399359, 0.155193],
  [0.926470, 0.405389, 0.150292],
  [0.929644, 0.411479, 0.145367],
  [0.932737, 0.417627, 0.140417],
  [0.935747, 0.423831, 0.135440],
  [0.938675, 0.430091, 0.130438],
  [0.941521, 0.436405, 0.125409],
  [0.944285, 0.442772, 0.120354],
  [0.946965, 0.449191, 0.115272],
  [0.949562, 0.455660, 0.110164],
  [0.952075, 0.462178, 0.105031],
  [0.954506, 0.468744, 0.099874],
  [0.956852, 0.475356, 0.094695],
  [0.959114, 0.482014, 0.089499],
  [0.961293, 0.488716, 0.084289],
  [0.963387, 0.495462, 0.079073],
  [0.965397, 0.502249, 0.073859],
  [0.967322, 0.509078, 0.068659],
  [0.969163, 0.515946, 0.063488],
  [0.970919, 0.522853, 0.058367],
  [0.972590, 0.529798, 0.053324],
  [0.974176, 0.536780, 0.048392],
  [0.975677, 0.543798, 0.043618],
  [0.977092, 0.550850, 0.039050],
  [0.978422, 0.557937, 0.034931],
  [0.979666, 0.565057, 0.031409],
  [0.980824, 0.572209, 0.028508],
  [0.981895, 0.579392, 0.026250],
  [0.982881, 0.586606, 0.024661],
  [0.983779, 0.593849, 0.023770],
  [0.984591, 0.601122, 0.023606],
  [0.985315, 0.608422, 0.024202],
  [0.985952, 0.615750, 0.025592],
  [0.986502, 0.623105, 0.027814],
  [0.986964, 0.630485, 0.030908],
  [0.987337, 0.637890, 0.034916],
  [0.987622, 0.645320, 0.039886],
  [0.987819, 0.652773, 0.045581],
  [0.987926, 0.660250, 0.051750],
  [0.987945, 0.667748, 0.058329],
  [0.987874, 0.675267, 0.065257],
  [0.987714, 0.682807, 0.072489],
  [0.987464, 0.690366, 0.079990],
  [0.987124, 0.697944, 0.087731],
  [0.986694, 0.705540, 0.095694],
  [0.986175, 0.713153, 0.103863],
  [0.985566, 0.720782, 0.112229],
  [0.984865, 0.728427, 0.120785],
  [0.984075, 0.736087, 0.129527],
  [0.983196, 0.743758, 0.138453],
  [0.982228, 0.751442, 0.147565],
  [0.981173, 0.759135, 0.156863],
  [0.980032, 0.766837, 0.166353],
  [0.978806, 0.774545, 0.176037],
  [0.977497, 0.782258, 0.185923],
  [0.976108, 0.789974, 0.196018],
  [0.974638, 0.797692, 0.206332],
  [0.973088, 0.805409, 0.216877],
  [0.971468, 0.813122, 0.227658],
  [0.969783, 0.820825, 0.238686],
  [0.968041, 0.828515, 0.249972],
  [0.966243, 0.836191, 0.261534],
  [0.964394, 0.843848, 0.273391],
  [0.962517, 0.851476, 0.285546],
  [0.960626, 0.859069, 0.298010],
  [0.958720, 0.866624, 0.310820],
  [0.956834, 0.874129, 0.323974],
  [0.954997, 0.881569, 0.337475],
  [0.953215, 0.888942, 0.351369],
  [0.951546, 0.896226, 0.365627],
  [0.950018, 0.903409, 0.380271],
  [0.948683, 0.910473, 0.395289],
  [0.947594, 0.917399, 0.410665],
  [0.946809, 0.924168, 0.426373],
  [0.946392, 0.930761, 0.442367],
  [0.946403, 0.937159, 0.458592],
  [0.946903, 0.943348, 0.474970],
  [0.947937, 0.949318, 0.491426],
  [0.949545, 0.955063, 0.507860],
  [0.951740, 0.960587, 0.524203],
  [0.954529, 0.965896, 0.540361],
  [0.957896, 0.971003, 0.556275],
  [0.961812, 0.975924, 0.571925],
  [0.966249, 0.980678, 0.587206],
  [0.971162, 0.985282, 0.602154],
  [0.976511, 0.989753, 0.616760],
  [0.982257, 0.994109, 0.631017],
  [0.988362, 0.998364, 0.644924]
];

export const TURBO_COLORMAP = [
  [0.189950, 0.071760, 0.232170],
  [0.194830, 0.083390, 0.261490],
  [0.199560, 0.094980, 0.290240],
  [0.204150, 0.106520, 0.318440],
  [0.208600, 0.118020, 0.346070],
  [0.212910, 0.129470, 0.373140],
  [0.217080, 0.140870, 0.399640],
  [0.221110, 0.152230, 0.425580],
  [0.225000, 0.163540, 0.450960],
  [0.228750, 0.174810, 0.475780],
  [0.232360, 0.186030, 0.500040],
  [0.235820, 0.197200, 0.523730],
  [0.239150, 0.208330, 0.546860],
  [0.242340, 0.219410, 0.569420],
  [0.245390, 0.230440, 0.591420],
  [0.248300, 0.241430, 0.612860],
  [0.251070, 0.252370, 0.633740],
  [0.253690, 0.263270, 0.654060],
  [0.256180, 0.274120, 0.673810],
  [0.258530, 0.284920, 0.693000],
  [0.260740, 0.295680, 0.711620],
  [0.262800, 0.306390, 0.729680],
  [0.264730, 0.317060, 0.747180],
  [0.266520, 0.327680, 0.764120],
  [0.268160, 0.338250, 0.780500],
  [0.269670, 0.348780, 0.796310],
  [0.271030, 0.359260, 0.811560],
  [0.272260, 0.369700, 0.826240],
  [0.273340, 0.380080, 0.840370],
  [0.274290, 0.390430, 0.853930],
  [0.275090, 0.400720, 0.866920],
  [0.275760, 0.410970, 0.879360],
  [0.276280, 0.421180, 0.891230],
  [0.276670, 0.431340, 0.902540],
  [0.276910, 0.441450, 0.913280],
  [0.277010, 0.451520, 0.923470],
  [0.276980, 0.461530, 0.933090],
  [0.276800, 0.471510, 0.942140],
  [0.276480, 0.481440, 0.950640],
  [0.276030, 0.491320, 0.958570],
  [0.275430, 0.501150, 0.965940],
  [0.274690, 0.510940, 0.972750],
  [0.273810, 0.520690, 0.978990],
  [0.272730, 0.530400, 0.984610],
  [0.271060, 0.540150, 0.989300],
  [0.268780, 0.549950, 0.993030],
  [0.265920, 0.559790, 0.995830],
  [0.262520, 0.569670, 0.997730],
  [0.258620, 0.579580, 0.998760],
  [0.254250, 0.589500, 0.998960],
  [0.249460, 0.599430, 0.998350],
  [0.244270, 0.609370, 0.996970],
  [0.238740, 0.619310, 0.994850],
  [0.232880, 0.629230, 0.992020],
  [0.226760, 0.639130, 0.988510],
  [0.220390, 0.649010, 0.984360],
  [0.213820, 0.658860, 0.979590],
  [0.207080, 0.668660, 0.974230],
  [0.200210, 0.678420, 0.968330],
  [0.193260, 0.688120, 0.961900],
  [0.186250, 0.697750, 0.954980],
  [0.179230, 0.707320, 0.947610],
  [0.172230, 0.716800, 0.939810],
  [0.165290, 0.726200, 0.931610],
  [0.158440, 0.735510, 0.923050],
  [0.151730, 0.744720, 0.914160],
  [0.145190, 0.753810, 0.904960],
  [0.138860, 0.762790, 0.895500],
  [0.132780, 0.771650, 0.885800],
  [0.126980, 0.780370, 0.875900],
  [0.121510, 0.788960, 0.865810],
  [0.116390, 0.797400, 0.855590],
  [0.111670, 0.805690, 0.845250],
  [0.107380, 0.813810, 0.834840],
  [0.103570, 0.821770, 0.824370],
  [0.100260, 0.829550, 0.813890],
  [0.097500, 0.837140, 0.803420],
  [0.095320, 0.844550, 0.792990],
  [0.093770, 0.851750, 0.782640],
  [0.092870, 0.858750, 0.772400],
  [0.092670, 0.865540, 0.762300],
  [0.093200, 0.872110, 0.752370],
  [0.094510, 0.878440, 0.742650],
  [0.096620, 0.884540, 0.733160],
  [0.099580, 0.890400, 0.723930],
  [0.103420, 0.896000, 0.715000],
  [0.108150, 0.901420, 0.705990],
  [0.113740, 0.906730, 0.696510],
  [0.120140, 0.911930, 0.686600],
  [0.127330, 0.917010, 0.676270],
  [0.135260, 0.921970, 0.665560],
  [0.143910, 0.926800, 0.654480],
  [0.153230, 0.931510, 0.643080],
  [0.163190, 0.936090, 0.631370],
  [0.173770, 0.940530, 0.619380],
  [0.184910, 0.944840, 0.607130],
  [0.196590, 0.949010, 0.594660],
  [0.208770, 0.953040, 0.581990],
  [0.221420, 0.956920, 0.569140],
  [0.234490, 0.960650, 0.556140],
  [0.247970, 0.964230, 0.543030],
  [0.261800, 0.967650, 0.529810],
  [0.275970, 0.970920, 0.516530],
  [0.290420, 0.974030, 0.503210],
  [0.305130, 0.976970, 0.489870],
  [0.320060, 0.979740, 0.476540],
  [0.335170, 0.982340, 0.463250],
  [0.350430, 0.984770, 0.450020],
  [0.365810, 0.987020, 0.436880],
  [0.381270, 0.989090, 0.423860],
  [0.396780, 0.990980, 0.410980],
  [0.412290, 0.992680, 0.398260],
  [0.427780, 0.994190, 0.385750],
  [0.443210, 0.995510, 0.373450],
  [0.458540, 0.996630, 0.361400],
  [0.473750, 0.997550, 0.349630],
  [0.488790, 0.998280, 0.338160],
  [0.503620, 0.998790, 0.327010],
  [0.518220, 0.999100, 0.316220],
  [0.532550, 0.999190, 0.305810],
  [0.546580, 0.999070, 0.295810],
  [0.560260, 0.998730, 0.286230],
  [0.573570, 0.998170, 0.277120],
  [0.586460, 0.997390, 0.268490],
  [0.598910, 0.996380, 0.260380],
  [0.610880, 0.995140, 0.252800],
  [0.622330, 0.993660, 0.245790],
  [0.633230, 0.991950, 0.239370],
  [0.643620, 0.989990, 0.233560],
  [0.653940, 0.987750, 0.228350],
  [0.664280, 0.985240, 0.223700],
  [0.674620, 0.982460, 0.219600],
  [0.684940, 0.979410, 0.216020],
  [0.695250, 0.976100, 0.212940],
  [0.705530, 0.972550, 0.210320],
  [0.715770, 0.968750, 0.208150],
  [0.725960, 0.964700, 0.206400],
  [0.736100, 0.960430, 0.205040],
  [0.746170, 0.955930, 0.204060],
  [0.756170, 0.951210, 0.203430],
  [0.766080, 0.946270, 0.203110],
  [0.775910, 0.941130, 0.203100],
  [0.785630, 0.935790, 0.203360],
  [0.795240, 0.930250, 0.203860],
  [0.804730, 0.924520, 0.204590],
  [0.814100, 0.918610, 0.205520],
  [0.823330, 0.912530, 0.206630],
  [0.832410, 0.906270, 0.207880],
  [0.841330, 0.899860, 0.209260],
  [0.850100, 0.893280, 0.210740],
  [0.858680, 0.886550, 0.212300],
  [0.867090, 0.879680, 0.213910],
  [0.875300, 0.872670, 0.215550],
  [0.883310, 0.865530, 0.217190],
  [0.891120, 0.858260, 0.218800],
  [0.898700, 0.850870, 0.220380],
  [0.906050, 0.843370, 0.221880],
  [0.913170, 0.835760, 0.223280],
  [0.920040, 0.828060, 0.224560],
  [0.926660, 0.820250, 0.225700],
  [0.933010, 0.812360, 0.226670],
  [0.939090, 0.804390, 0.227440],
  [0.944890, 0.796340, 0.228000],
  [0.950390, 0.788230, 0.228310],
  [0.955600, 0.780050, 0.228360],
  [0.960490, 0.771810, 0.228110],
  [0.965070, 0.763520, 0.227540],
  [0.969310, 0.755190, 0.226630],
  [0.973230, 0.746820, 0.225360],
  [0.976790, 0.738420, 0.223690],
  [0.980000, 0.730000, 0.221610],
  [0.982890, 0.721400, 0.219180],
  [0.985490, 0.712500, 0.216500],
  [0.987810, 0.703300, 0.213580],
  [0.989860, 0.693820, 0.210430],
  [0.991630, 0.684080, 0.207060],
  [0.993140, 0.674080, 0.203480],
  [0.994380, 0.663860, 0.199710],
  [0.995350, 0.653410, 0.195770],
  [0.996070, 0.642770, 0.191650],
  [0.996540, 0.631930, 0.187380],
  [0.996750, 0.620930, 0.182970],
  [0.996720, 0.609770, 0.178420],
  [0.996440, 0.598460, 0.173760],
  [0.995930, 0.587030, 0.168990],
  [0.995170, 0.575490, 0.164120],
  [0.994190, 0.563860, 0.159180],
  [0.992970, 0.552140, 0.154170],
  [0.991530, 0.540360, 0.149100],
  [0.989870, 0.528540, 0.143980],
  [0.987990, 0.516670, 0.138830],
  [0.985900, 0.504790, 0.133670],
  [0.983600, 0.492910, 0.128490],
  [0.981080, 0.481040, 0.123320],
  [0.978370, 0.469200, 0.118170],
  [0.975450, 0.457400, 0.113050],
  [0.972340, 0.445650, 0.107970],
  [0.969040, 0.433990, 0.102940],
  [0.965550, 0.422410, 0.097980],
  [0.961870, 0.410930, 0.093100],
  [0.958010, 0.399580, 0.088310],
  [0.953980, 0.388360, 0.083620],
  [0.949770, 0.377290, 0.079050],
  [0.945380, 0.366380, 0.074610],
  [0.940840, 0.355660, 0.070310],
  [0.936120, 0.345130, 0.066160],
  [0.931250, 0.334820, 0.062180],
  [0.926230, 0.324730, 0.058370],
  [0.921050, 0.314890, 0.054750],
  [0.915720, 0.305300, 0.051340],
  [0.910240, 0.295990, 0.048140],
  [0.904630, 0.286960, 0.045160],
  [0.898880, 0.278240, 0.042430],
  [0.892980, 0.269810, 0.039930],
  [0.886910, 0.261520, 0.037530],
  [0.880660, 0.253340, 0.035210],
  [0.874220, 0.245260, 0.032970],
  [0.867600, 0.237300, 0.030820],
  [0.860790, 0.229450, 0.028750],
  [0.853800, 0.221700, 0.026770],
  [0.846620, 0.214070, 0.024870],
  [0.839260, 0.206540, 0.023050],
  [0.831720, 0.199120, 0.021310],
  [0.823990, 0.191820, 0.019660],
  [0.816080, 0.184620, 0.018090],
  [0.807990, 0.177530, 0.016600],
  [0.799710, 0.170550, 0.015200],
  [0.791250, 0.163680, 0.013870],
  [0.782600, 0.156930, 0.012640],
  [0.773770, 0.150280, 0.011480],
  [0.764760, 0.143740, 0.010410],
  [0.755560, 0.137310, 0.009420],
  [0.746170, 0.130980, 0.008510],
  [0.736610, 0.124770, 0.007690],
  [0.726860, 0.118670, 0.006950],
  [0.716920, 0.112680, 0.006290],
  [0.706800, 0.106800, 0.005710],
  [0.696500, 0.101020, 0.005220],
  [0.686020, 0.095360, 0.004810],
  [0.675350, 0.089800, 0.004490],
  [0.664490, 0.084360, 0.004240],
  [0.653450, 0.079020, 0.004080],
  [0.642230, 0.073800, 0.004010],
  [0.630820, 0.068680, 0.004010],
  [0.619230, 0.063670, 0.004100],
  [0.607460, 0.058780, 0.004270],
  [0.595500, 0.053990, 0.004530],
  [0.583360, 0.049310, 0.004860],
  [0.571030, 0.044740, 0.005290],
  [0.558520, 0.040280, 0.005790],
  [0.545830, 0.035930, 0.006380],
  [0.532950, 0.031690, 0.007050],
  [0.519890, 0.027560, 0.007800],
  [0.506640, 0.023540, 0.008630],
  [0.493210, 0.019630, 0.009550],
  [0.479600, 0.015830, 0.010550]
];

export const GRAY_COLORMAP = [
  [0.000000, 0.000000, 0.000000],
  [0.003922, 0.003922, 0.003922],
  [0.007843, 0.007843, 0.007843],
  [0.011765, 0.011765, 0.011765],
  [0.015686, 0.015686, 0.015686],
  [0.019608, 0.019608, 0.019608],
  [0.023529, 0.023529, 0.023529],
  [0.027451, 0.027451, 0.027451],
  [0.031373, 0.031373, 0.031373],
  [0.035294, 0.035294, 0.035294],
  [0.039216, 0.039216, 0.039216],
  [0.043137, 0.043137, 0.043137],
  [0.047059, 0.047059, 0.047059],
  [0.050980, 0.050980, 0.050980],
  [0.054902, 0.054902, 0.054902],
  [0.058824, 0.058824, 0.058824],
  [0.062745, 0.062745, 0.062745],
  [0.066667, 0.066667, 0.066667],
  [0.070588, 0.070588, 0.070588],
  [0.074510, 0.074510, 0.074510],
  [0.078431, 0.078431, 0.078431],
  [0.082353, 0.082353, 0.082353],
  [0.086275, 0.086275, 0.086275],
  [0.090196, 0.090196, 0.090196],
  [0.094118, 0.094118, 0.094118],
  [0.098039, 0.098039, 0.098039],
  [0.101961, 0.101961, 0.101961],
  [0.105882, 0.105882, 0.105882],
  [0.109804, 0.109804, 0.109804],
  [0.113725, 0.113725, 0.113725],
  [0.117647, 0.117647, 0.117647],
  [0.121569, 0.121569, 0.121569],
  [0.125490, 0.125490, 0.125490],
  [0.129412, 0.129412, 0.129412],
  [0.133333, 0.133333, 0.133333],
  [0.137255, 0.137255, 0.137255],
  [0.141176, 0.141176, 0.141176],
  [0.145098, 0.145098, 0.145098],
  [0.149020, 0.149020, 0.149020],
  [0.152941, 0.152941, 0.152941],
  [0.156863, 0.156863, 0.156863],
  [0.160784, 0.160784, 0.160784],
  [0.164706, 0.164706, 0.164706],
  [0.168627, 0.168627, 0.168627],
  [0.172549, 0.172549, 0.172549],
  [0.176471, 0.176471, 0.176471],
  [0.180392, 0.180392, 0.180392],
  [0.184314, 0.184314, 0.184314],
  [0.188235, 0.188235, 0.188235],
  [0.192157, 0.192157, 0.192157],
  [0.196078, 0.196078, 0.196078],
  [0.200000, 0.200000, 0.200000],
  [0.203922, 0.203922, 0.203922],
  [0.207843, 0.207843, 0.207843],
  [0.211765, 0.211765, 0.211765],
  [0.215686, 0.215686, 0.215686],
  [0.219608, 0.219608, 0.219608],
  [0.223529, 0.223529, 0.223529],
  [0.227451, 0.227451, 0.227451],
  [0.231373, 0.231373, 0.231373],
  [0.235294, 0.235294, 0.235294],
  [0.239216, 0.239216, 0.239216],
  [0.243137, 0.243137, 0.243137],
  [0.247059, 0.247059, 0.247059],
  [0.250980, 0.250980, 0.250980],
  [0.254902, 0.254902, 0.254902],
  [0.258824, 0.258824, 0.258824],
  [0.262745, 0.262745, 0.262745],
  [0.266667, 0.266667, 0.266667],
  [0.270588, 0.270588, 0.270588],
  [0.274510, 0.274510, 0.274510],
  [0.278431, 0.278431, 0.278431],
  [0.282353, 0.282353, 0.282353],
  [0.286275, 0.286275, 0.286275],
  [0.290196, 0.290196, 0.290196],
  [0.294118, 0.294118, 0.294118],
  [0.298039, 0.298039, 0.298039],
  [0.301961, 0.301961, 0.301961],
  [0.305882, 0.305882, 0.305882],
  [0.309804, 0.309804, 0.309804],
  [0.313725, 0.313725, 0.313725],
  [0.317647, 0.317647, 0.317647],
  [0.321569, 0.321569, 0.321569],
  [0.325490, 0.325490, 0.325490],
  [0.329412, 0.329412, 0.329412],
  [0.333333, 0.333333, 0.333333],
  [0.337255, 0.337255, 0.337255],
  [0.341176, 0.341176, 0.341176],
  [0.345098, 0.345098, 0.345098],
  [0.349020, 0.349020, 0.349020],
  [0.352941, 0.352941, 0.352941],
  [0.356863, 0.356863, 0.356863],
  [0.360784, 0.360784, 0.360784],
  [0.364706, 0.364706, 0.364706],
  [0.368627, 0.368627, 0.368627],
  [0.372549, 0.372549, 0.372549],
  [0.376471, 0.376471, 0.376471],
  [0.380392, 0.380392, 0.380392],
  [0.384314, 0.384314, 0.384314],
  [0.388235, 0.388235, 0.388235],
  [0.392157, 0.392157, 0.392157],
  [0.396078, 0.396078, 0.396078],
  [0.400000, 0.400000, 0.400000],
  [0.403922, 0.403922, 0.403922],
  [0.407843, 0.407843, 0.407843],
  [0.411765, 0.411765, 0.411765],
  [0.415686, 0.415686, 0.415686],
  [0.419608, 0.419608, 0.419608],
  [0.423529, 0.423529, 0.423529],
  [0.427451, 0.427451, 0.427451],
  [0.431373, 0.431373, 0.431373],
  [0.435294, 0.435294, 0.435294],
  [0.439216, 0.439216, 0.439216],
  [0.443137, 0.443137, 0.443137],
  [0.447059, 0.447059, 0.447059],
  [0.450980, 0.450980, 0.450980],
  [0.454902, 0.454902, 0.454902],
  [0.458824, 0.458824, 0.458824],
  [0.462745, 0.462745, 0.462745],
  [0.466667, 0.466667, 0.466667],
  [0.470588, 0.470588, 0.470588],
  [0.474510, 0.474510, 0.474510],
  [0.478431, 0.478431, 0.478431],
  [0.482353, 0.482353, 0.482353],
  [0.486275, 0.486275, 0.486275],
  [0.490196, 0.490196, 0.490196],
  [0.494118, 0.494118, 0.494118],
  [0.498039, 0.498039, 0.498039],
  [0.501961, 0.501961, 0.501961],
  [0.505882, 0.505882, 0.505882],
  [0.509804, 0.509804, 0.509804],
  [0.513725, 0.513725, 0.513725],
  [0.517647, 0.517647, 0.517647],
  [0.521569, 0.521569, 0.521569],
  [0.525490, 0.525490, 0.525490],
  [0.529412, 0.529412, 0.529412],
  [0.533333, 0.533333, 0.533333],
  [0.537255, 0.537255, 0.537255],
  [0.541176, 0.541176, 0.541176],
  [0.545098, 0.545098, 0.545098],
  [0.549020, 0.549020, 0.549020],
  [0.552941, 0.552941, 0.552941],
  [0.556863, 0.556863, 0.556863],
  [0.560784, 0.560784, 0.560784],
  [0.564706, 0.564706, 0.564706],
  [0.568627, 0.568627, 0.568627],
  [0.572549, 0.572549, 0.572549],
  [0.576471, 0.576471, 0.576471],
  [0.580392, 0.580392, 0.580392],
  [0.584314, 0.584314, 0.584314],
  [0.588235, 0.588235, 0.588235],
  [0.592157, 0.592157, 0.592157],
  [0.596078, 0.596078, 0.596078],
  [0.600000, 0.600000, 0.600000],
  [0.603922, 0.603922, 0.603922],
  [0.607843, 0.607843, 0.607843],
  [0.611765, 0.611765, 0.611765],
  [0.615686, 0.615686, 0.615686],
  [0.619608, 0.619608, 0.619608],
  [0.623529, 0.623529, 0.623529],
  [0.627451, 0.627451, 0.627451],
  [0.631373, 0.631373, 0.631373],
  [0.635294, 0.635294, 0.635294],
  [0.639216, 0.639216, 0.639216],
  [0.643137, 0.643137, 0.643137],
  [0.647059, 0.647059, 0.647059],
  [0.650980, 0.650980, 0.650980],
  [0.654902, 0.654902, 0.654902],
  [0.658824, 0.658824, 0.658824],
  [0.662745, 0.662745, 0.662745],
  [0.666667, 0.666667, 0.666667],
  [0.670588, 0.670588, 0.670588],
  [0.674510, 0.674510, 0.674510],
  [0.678431, 0.678431, 0.678431],
  [0.682353, 0.682353, 0.682353],
  [0.686275, 0.686275, 0.686275],
  [0.690196, 0.690196, 0.690196],
  [0.694118, 0.694118, 0.694118],
  [0.698039, 0.698039, 0.698039],
  [0.701961, 0.701961, 0.701961],
  [0.705882, 0.705882, 0.705882],
  [0.709804, 0.709804, 0.709804],
  [0.713725, 0.713725, 0.713725],
  [0.717647, 0.717647, 0.717647],
  [0.721569, 0.721569, 0.721569],
  [0.725490, 0.725490, 0.725490],
  [0.729412, 0.729412, 0.729412],
  [0.733333, 0.733333, 0.733333],
  [0.737255, 0.737255, 0.737255],
  [0.741176, 0.741176, 0.741176],
  [0.745098, 0.745098, 0.745098],
  [0.749020, 0.749020, 0.749020],
  [0.752941, 0.752941, 0.752941],
  [0.756863, 0.756863, 0.756863],
  [0.760784, 0.760784, 0.760784],
  [0.764706, 0.764706, 0.764706],
  [0.768627, 0.768627, 0.768627],
  [0.772549, 0.772549, 0.772549],
  [0.776471, 0.776471, 0.776471],
  [0.780392, 0.780392, 0.780392],
  [0.784314, 0.784314, 0.784314],
  [0.788235, 0.788235, 0.788235],
  [0.792157, 0.792157, 0.792157],
  [0.796078, 0.796078, 0.796078],
  [0.800000, 0.800000, 0.800000],
  [0.803922, 0.803922, 0.803922],
  [0.807843, 0.807843, 0.807843],
  [0.811765, 0.811765, 0.811765],
  [0.815686, 0.815686, 0.815686],
  [0.819608, 0.819608, 0.819608],
  [0.823529, 0.823529, 0.823529],
  [0.827451, 0.827451, 0.827451],
  [0.831373, 0.831373, 0.831373],
  [0.835294, 0.835294, 0.835294],
  [0.839216, 0.839216, 0.839216],
  [0.843137, 0.843137, 0.843137],
  [0.847059, 0.847059, 0.847059],
  [0.850980, 0.850980, 0.850980],
  [0.854902, 0.854902, 0.854902],
  [0.858824, 0.858824, 0.858824],
  [0.862745, 0.862745, 0.862745],
  [0.866667, 0.866667, 0.866667],
  [0.870588, 0.870588, 0.870588],
  [0.874510, 0.874510, 0.874510],
  [0.878431, 0.878431, 0.878431],
  [0.882353, 0.882353, 0.882353],
  [0.886275, 0.886275, 0.886275],
  [0.890196, 0.890196, 0.890196],
  [0.894118, 0.894118, 0.894118],
  [0.898039, 0.898039, 0.898039],
  [0.901961, 0.901961, 0.901961],
  [0.905882, 0.905882, 0.905882],
  [0.909804, 0.909804, 0.909804],
  [0.913725, 0.913725, 0.913725],
  [0.917647, 0.917647, 0.917647],
  [0.921569, 0.921569, 0.921569],
  [0.925490, 0.925490, 0.925490],
  [0.929412, 0.929412, 0.929412],
  [0.933333, 0.933333, 0.933333],
  [0.937255, 0.937255, 0.937255],
  [0.941176, 0.941176, 0.941176],
  [0.945098, 0.945098, 0.945098],
  [0.949020, 0.949020, 0.949020],
  [0.952941, 0.952941, 0.952941],
  [0.956863, 0.956863, 0.956863],
  [0.960784, 0.960784, 0.960784],
  [0.964706, 0.964706, 0.964706],
  [0.968627, 0.968627, 0.968627],
  [0.972549, 0.972549, 0.972549],
  [0.976471, 0.976471, 0.976471],
  [0.980392, 0.980392, 0.980392],
  [0.984314, 0.984314, 0.984314],
  [0.988235, 0.988235, 0.988235],
  [0.992157, 0.992157, 0.992157],
  [0.996078, 0.996078, 0.996078],
  [1.000000, 1.000000, 1.000000]
];
